<?php include_once './application/views/sys_admin/common/header.php';  ?>
<?php 
$sex = $v['sex'];
$statusArr = $v['statusArr'];
$cardType = $v['cardType'];
?>
<div class=" definewidth m20">
	<form id="myform">
		<input type="hidden" name="act" value="edit"/>
		<table class="table table-bordered table-hover m10">
		 <tr>
	        <td class="tableleft">用户推广码</td>
	        <td><?php echo $info['user_id']; ?></td>
	        <td class="tableleft">用户名</td>
	        <td><?php echo $info['username']; ?></td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">邮箱</td>
	        <td><input type="text" class="input"  name="email" id="email" value="<?php echo $info['email'];?>"/></td>
	        <td class="tableleft">客户类型</td>
	        <td>
	        <select name="type_id" class="pubput">
				<?php foreach($varr['userType'] as $tk=>$tv){?>
				<option value="<?php echo $tk;?>" <?php if ($info['type_id']==$tk) echo "selected='selected'"; ?>><?php echo $tv;?></option>
				<?php }?>
			</select> 
			</td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">登陆密码</td>
	        <td><input type="password" class="input" name="password" id="password"/> </td>
	        <td class="tableleft">确认密码</td>
	        <td><input type="password" class="input" name="password2" id="password2" /> </td>
	   	</tr>
	   		<tr>
	        <td class="tableleft">是否内部账户</td>
	        <td><input type="radio" name="is_self" value="0" <?php if ($info['is_self']==0) echo "checked='checked'"; ?>/>否  
				<input type="radio" name="is_self" value="1" <?php if ($info['is_self']==1) echo "checked='checked'"; ?>/>是
			 </td>
	        <td class="tableleft">状态</td>
	        <td>
	        <?php foreach($varr['userFstatus'] as $fk=>$fv){?>
				<input type="radio" name="fstatus" value="<?php echo $fk;?>" <?php if ($info['fstatus']==$fk) echo "checked='checked'"; ?>/><?php echo $fv;?>
			<?php }?> 
	        </td>
	   	</tr>
	   		   		<tr>
	   			<!--
	        <td class="tableleft">生日</td>
	        <td><input type="text" class="pubinput" name="birthday" id="birthday" onfocus="WdatePicker()" value="<?php echo $info['birthday'] ? date('Y-m-d',$info['birthday']) : '';?>" readonly="readonly"/> </td>
	        --->
    <td class="tableleft">手机</td>
	        <td><input readonly="readonly" type="text" class="pubinput" name="phone" id="phone" value="<?php echo $info['phone'];?>"/> （不允许修改） </td>
	
	   	 	<td class="tableleft">手机认证</td>
	        <td>
	        <?php foreach($varr['statusArr'] as $pk=>$pv){?>
				<input type="radio" name="phone_status" value="<?php echo $pk;?>" <?php if ($info['phone_status']==$pk) echo "checked='checked'"; ?>/><?php echo $pv;?>
			<?php }?>
			</td>
			<!--
	        <td class="tableleft">是否黑名单</td>
	        <td>
	        <?php foreach($varr['userLock'] as $lk=>$lock){?>
			<input type="radio" name="islock" value="<?php echo $lk;?>" <?php if ($info['islock']==$lk) echo "checked='checked'"; ?>/><?php echo $lock;?> 
			<?php }?>
	        </td>
	        -->
	   		<tr>
	        <td class="tableleft">真实姓名</td>
	        <td><input type="text" readonly="readonly" class="pubinput" name="realname" id="realname" value="<?php echo $info['realname'];?>"/> （不允许修改） </td>
	        <td class="tableleft">性别</td>
	        <td> 
	        <?php foreach($varr['sex'] as $sk=>$sv){?>
				<input type="radio" name="sex" value="<?php echo $sk;?>" <?php if ($info['sex']==$sk) echo "checked='checked'"; ?>/><?php echo $sv;?>
			<?php }?>
	        </td>
	   	</tr>
	   	</tr>

	   	</tr>
	   	<tr>

	         
	         	        <td class="tableleft">证件类型</td>
	        <td>
	        <select name="card_type" class="pubput">
			<?php foreach ($varr['cardType'] as $k=>$v){?>
				<option value="<?php echo $k;?>" <?php if ($info['card_type']==$k) echo "selected='selected'"; ?>><?php echo $v;?></option>
			<?php }?>
			</select> 
			<input type="text" name="card_id" readonly="readonly" id="card_id" class="input" value="<?php echo $info['card_id'];?>"/>（不允许修改） 
	         </td>
	         	        <td class="tableleft">实名认证</td>
	        <td>
	        <?php foreach($varr['statusArr'] as $rk=>$rv){?>
				<input type="radio" name="real_status" value="<?php echo $rk;?>" <?php if ($info['real_status']==$rk) echo "checked='checked'"; ?>/><?php echo $rv;?>
			<?php }?>
	         </td>
	    
	   	</tr>

	   	
	   	<tr>
		 <td class="tableleft">身份证正面：</td>
		 <td ><a <?php if(isset($info['card_pic1'])&& !empty($info['card_pic1'])) echo "href = /".$info['card_pic1'];?> target = "_blank" ><img style="width:500px; height:300px;"  src="/<?php echo $info['card_pic1'];?>"/></a></td>
		  <td class="tableleft">身份证反面：</td>
		 <td ><a <?php if(isset($info['card_pic2'])&& !empty($info['card_pic2'])) echo "href = /".$info['card_pic2'];?> target = "_blank" ><img style="width:500px; height:300px;"   src="/<?php echo $info['card_pic2'];?>"/></a></td>
		</tr>
			<tr>
		
		
		</tr>
	   	<tr>
	   	 	<td class="tableleft">登陆错误次数</td>
	        <td><input type="text" class="pubinput" name="error_num" id="error_num" value="<?php echo $info['error_num'];?>"/>（错误5次锁定登陆，解锁把次数改为0） </td>
	        <td class="tableleft"></td>
	        <td><button type="button" class="btn btn-success"  onclick="toSubmit();" >提交</button> </td>
	   	</tr>
	   </table>
	</form>
</div>

<script>
function toSubmit(){
	var options = {
		url : '',
		dataType: "json",
		type:"post",
		success : function(ret) {
			$('#dialog').dialog({
				modal:true,
				title:'系统提示',
				buttons:{"确定":function(){$(this).dialog("close");}},
				close: function() {
					location=ret.url;
				}
			}); 
			$("#msg").html(ret.msg);
		}
	};
	$("#myform").ajaxSubmit(options);
	return false;
}
</script>			
<div id="dialog" style="display:none">
<p id="msg" style="text-align:center"></p>
</div>
